<template>
    <div class="newsinfo-contaner">
        <!-- 大标题 -->
        <h3 class="title">新闻标题</h3>
        <!-- 小标题 -->
        <p class="subtitle">
            <span>发表时间：</span>
            <span>点击： 0次</span>
        </p>
        <hr/>
        <!-- 内容区域 -->
        <div class="content">

        </div>

        <!-- 评论区域 -->
        <comment-box :id="this.id"></comment-box>
    </div>
</template>
<script>
import {Toast} from 'mint-ui'
import comment from '../subcomponents/comment.vue'
export default {
    data(){
        return{
            id: this.$route.params.id,
            newsinfo:{}
        }
    },
    created(){
        this.getNewsInfo()
    },
    methods: {
        getNewsInfo(){
            this.$http.get('https://api.apiopen.top/musicDetails'+this.id).then(res => {
                if(res.body.code == 400){
                    this.newsinfo = res.body.result[0]
                }else{
                    Toast('获取新闻数据失败！！！')
                }
            })
        }
    },
    components: {
        'comment-box':comment
    }
}
</script>
<style lang="scss">
.newsinfo-contaner{
    padding:4px;
    .title{
        font-size: 16px;
        text-align: center;
        margin: 15px 0;
        color: red;
    }
    .subtitle{
        font-size: 14px;
        color: #226aff;
        display: flex;
        justify-content: space-between;
    }
    .content{
        img{
            width: 100%;
        }
    }
}
</style>
